// var buf = Buffer.from('www.baidu.com')
// var json = buf.toJSON(buf)
// console.log(json)

// var buf1 = Buffer.from('百度')
// var buf2 = Buffer.from('www.baidu.com')
// var buf3 = Buffer.concat([buf1, buf2])
// console.log(buf3.toString())

//buf.compare(otherBuffer) 比较两个buf是否相等

var buf1 = Buffer.from('12345')
var buf2 = Buffer.from('12345')
var result = buf1.compare(buf2)
console.log(result)